package com.test.SerializableTest.serial;


/**
 *  json：object___json string\ byte[]
 *  xml：object__xml_toString_byte[]
 *   网路传输：new String__ byte[] 字节传输....
 */
public class App {
    public static void main( String[] args ) {
        fastjson();
    }
    public static void fastjson(){
        // new FastjsonSerializer()
        ISerializer iSerializer=new XmlSerializer();
        User user=new User();
        user.setAge(18);
        user.setName("小白");
        user.setHobby("菲菲");
        user.setSex("男");

        byte[] rs=iSerializer.serializer(user);
        System.out.println(new String(rs));

        User user1=iSerializer.deSerializer(rs,User.class);
        System.out.println(user1+"->"+user1.getSex());
    }
}
